home *** CD-ROM | disk | FTP | other *** search
/ The 640 MEG Shareware Studio 2 / The 640 Meg Shareware Studio CD-ROM Volume II (Data Express)(1993).ISO / info / drdtips.zip / 1207.TXT < prev    next >
Text File  |  1992-09-09  |  8KB  |  210 lines

  1.                          FYI
  2.  
  3. (Note: The origin of this information may be internal or external
  4. to Novell.  Novell makes every effort within its means to verify
  5. this information.  However, the information provided in this
  6. document is FOR YOUR INFORMATION only.  Novell makes no explicit or
  7. implied claims to the validity of this information.)
  8.  
  9.  
  10.           TITLE: Selecting FDISK Partition Sizes
  11.    DOCUMENT ID#: FYI-M-1207
  12.            DATE: 08SEPT92
  13.         PRODUCT: DR DOS
  14. PRODUCT VERSION: 6
  15.     SUPPLEMENTS: FYI-M-1208 
  16.  
  17.      
  18. Important!
  19. This Technical Bulletin describes the calculations necessary in
  20. order to FDISK a hard drive with a specific cluster size. The
  21. information contained in this document is intended for advanced
  22. users and is not supported by Novell. 
  23.  
  24. The FDISK utility can erase all data on a physical drive and
  25. backups of any existing data are strongly recommended before using
  26. FDISK. 
  27.  
  28. The hard drive used as an example is a 405MB SCSI with 48 heads, 17
  29. sectors per track and 1024 cylinders. 2KB clusters with a 16 bit
  30. FAT are the target because this allows the maximum partition size
  31. in MegaBytes with the smallest possible cluster. The cluster size
  32. is kept as small as possible because this will be the smallest
  33. amount of disk space, in bytes, that will be used for any file
  34. (even zero byte files). This example assumes that the entire disk
  35. will be utilized for DOS media. 
  36.  
  37. Conventions:
  38. This document uses several mathematical formulas. To avoid
  39. confusion, the dash/minus character "-" is only used for math
  40. functions. Instead of using typical X or Y variables this document
  41. will use variable names. Only one word for each variable will be
  42. used. If a variable name would normally consist of more the one
  43. word the words will be connected with underscores "_" to tie them
  44. to a single name. An example would be the variable "sector size"
  45. which is used in this document as "sector_size".
  46.  
  47. Mathematical operators used:
  48. +    addition
  49. -    subtraction
  50. /    division
  51. *    multiplication
  52. <    less than
  53. ~=   approximately equal to
  54. =    equal to
  55.  
  56. Definitions:
  57. Hard Disk "Heads":  The number of heads for your hard disk. 
  58.  
  59. Sector:             A portion (or radial sector) of a track.
  60.  
  61. Track:              All sectors in a given track under a single
  62.                     hard disk head.
  63.  
  64. Cylinder:           All sectors in a given track under all of the
  65.                     hard disk heads. All "tracks" within the
  66.                     cylinder are parallel to the hard disk's 
  67.                     center of rotation. DOS supports a maximum of
  68.                     1024 cylinders per physical hard disk.
  69.  
  70. Partition:          A collection of cylinders used by an Operating
  71.                     System as it's file system.  By convention, all
  72.                     partitions start on cylinder boundaries.
  73.  
  74. Primary Partition:  Under DOS, this is the Active Partition (where
  75.                     DOS's system files are located).
  76.  
  77. Extended Partition: Under DOS, in order to reserve space on the
  78.                     hard disk as owned by DOS and therefore
  79.                     unavailable to any other operating system, 
  80.                     DOS creates an Extended Partition within which
  81.                     Logical Partitions can be created.
  82.  
  83. Logical Partition:  Under DOS, each Logical Partition resides
  84.                     within the Extended Partition. There should be
  85.                     at least one Logical Partition in the Extended
  86.                     Partition.
  87.  
  88. Constants:
  89. HD Head Count: 48 (30h)   This number is drive specific. In the
  90.                sample hard disk, this is a translated value.
  91.                Translation is a method that enables a disk with
  92.                more than 1024 cylinders to be supported by DOS. 
  93.  
  94. Sectors/Track: 17 (11h )   This number is drive specific, but
  95.                typically 17.
  96.  
  97. Sector Size:   512 bytes   Usually a constant, but if varied, this
  98.                value must be a power of 2.
  99.  
  100. Cylinder Count:1023   DOS and most other software have this upper
  101.                limit. Remember that this value is zero relative, so
  102.                1023 means 1024 total cylinders.
  103.  
  104. FAT Sizes:     12 bit fats  4096-18 reserved values = 4078 entries
  105.                16 bit fats 65536-18 reserved values = 65518 entries
  106.                (binary 1000000000000 = decimal 4096)
  107.  
  108. Cluster Sizes: 2KB clusters 4 sectors per cluster (512 bytes each
  109.                sector)
  110.                4KB clusters   8 sectors per cluster
  111.                8KB clusters   16 sectors per cluster
  112.                16KB clusters  32 sectors per cluster
  113.  
  114. Maximum DOS Partition Sizes:
  115. To determine the capacity of a drive multiply the FAT_SIZE with the
  116. CUSTER_SIZE. This will be the size in Bytes. To get the size in
  117. MegaBytes divide twice by 1024 and 3 times to get GigaBytes.
  118.  
  119. 8MB = 12 bit FATs * 2KB Clusters  = (((4077 * 2048) / 1024) / 1024)
  120.  
  121. 16MB= 12 bit FATs * 4KB Clusters  = (((4077 * 4096) / 1024) / 1024)
  122.  
  123. 32MB= 12 bit FATs * 8KB Clusters  = (((4077 * 8192) / 1024) / 1024)
  124.  
  125. 128MB= 16 bit FATs * 2KB Clusters  = (((65517 * 2048) / 1024) /  
  126.        1024)
  127.  
  128. 256MB= 16 bit FATs * 4KB Clusters  = (((65517 * 4096) / 1024) /   
  129.        1024)
  130.  
  131. 512MB= 16 bit FATs * 8KB Clusters  = (((65517 * 8192) / 1024) /   
  132.        1024)
  133.  
  134. 1GB = 16 bit FATs * 16KB Clusters = (((65517 * 16384) / 1024) /   
  135.       1024 / 1024)
  136.  
  137. 2GB = 16 bit FATs * 32KB Clusters = (((65517 * 32768) / 1024) /   
  138.       1024 / 1024)
  139.  
  140. Cluster sizes are a direct result of the size of the partition. 
  141. For example, requesting a partition size of 101M will result in a
  142. partition with 16 bit FATs and a cluster size of 2KB,  just as a 12
  143. bit FAT with 8KB clusters will be limited to 32MB.  The reason for
  144. support of 12 bit FATs is backward compatibility with versions of
  145. DOS prior to 3.0. 
  146.  
  147. Recommended Example of Logical Partition Layout:
  148. To get 2KB clusters, the partition needs to be greater than 32MB
  149. but less than 128MB. The example drive is 405MB. 4 Partitions of
  150. 101MB each will achieve the target cluster size.
  151.  
  152. 32MB < Primary Part. 1 < 128MB (101MB  16 bit FATs with 2KB
  153. Clusters)
  154.  
  155. 32MB < Logical Part. 2 < 128MB (101MB  16 bit FATs with 2KB
  156. Clusters)
  157.  
  158. 32MB < Logical Part. 3 < 128MB (101MB  16 bit FATs with 2KB
  159. Clusters)
  160.  
  161. 32MB < Logical Part. 4 < 128MB (101MB  16 bit FATs with 2KB
  162. Clusters)
  163.  
  164. Using FDISK to Create the Example Partitions:
  165. Assuming that the hard disk is empty of partitions, create the
  166. following partitions using FDISK.  Here are the necessary variables
  167. and formulas for performing this task: 
  168.  
  169. divisor  = number_of_heads * number_sectors_per_track * sector_size
  170. partition_size = size_of_partition_in_bytes / divisor
  171. max_cylinders   = 1023  
  172.  
  173. In our example of 48 heads, 17 sectors and 512 byte sector size,
  174. the divisor would be:
  175. divisor = 48 * 17 * 512 = 417,792
  176.  
  177. partition_size =  101MB / divisor = 101 * 1024 * 1024 / 417,792 = 
  178.  253.49 ~= 254
  179.  
  180. The reason for multiplying by 1024 twice is because the partition
  181. size is in Bytes not MegaBytes. Round up any fractional amount.
  182.  
  183. max_cylinders = 1023 (or the maximum cylinder count for the sample
  184. hard disk. FDISK will show you this value.)
  185.  
  186. Below is what is needed to create a disk with a 101MB primary
  187. partition and 3 logical drives of 101MB each in 1 extended
  188. partition. (This equates to having 4 drive letters - C: D: E: F:) 
  189.  
  190. 1) Primary Partition with a Cylinder Range of (0,254).
  191. Starting Cylinder = 0
  192. Ending Cylinder = 254 (partition_size calculated above)
  193.  
  194. 2) Create an Extended Partition with a Cylinder Range of (255,    
  195.    1023).
  196. Starting Cylinder = 255 (Ending Cylinder from step 1 + 1)
  197. Ending Cylinder  = 1023 (max_cylinders)
  198.  
  199. 3) Create a Logical Partition with a Cylinder Range of (255, 511).
  200. Starting Cylinder = 255 (Same as the Starting Cylinder for the    
  201.    Extended Partition in step 2.)
  202. Ending Cylinder  = 511 (Starting Cylinder + partition_size)
  203.  
  204. 4) Create a Logical Partition with a Cylinder Range of (512, 766).
  205. Starting Cylinder = 512 (Ending Cylinder from step 3 + 1)
  206. Ending Cylinder  = 766 (Starting Cylinder + partition_size)
  207.  
  208. 5) Create a Logical Partition with a Cylinder Range of (767, 1023).
  209. Starting Cylinder = 767 (Ending Cylinder of step 3 + 1)
  210. Ending Cylinder  = 1023 (Starting Cylinder + partition_size)